package com.gxa.service.investment.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gxa.entity.investment.ProjectCenter;
import com.gxa.entity.points.IntegralType;
import com.gxa.mapper.investment.ProjectCenterMapper;
import com.gxa.service.investment.ProjectCenterService;
import com.gxa.vo.ProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectCenterServiceImpl extends ServiceImpl<ProjectCenterMapper,ProjectCenter> implements ProjectCenterService {

    @Autowired
    private ProjectCenterMapper projectCenterMapper;

    @Override
    public PageInfo<ProjectCenter> queryAll(Integer pageNum, Integer pageSize) {
        Page<IntegralType> page1 = PageHelper.startPage(pageNum,pageSize);
        List<ProjectCenter> projectCenterList = this.projectCenterMapper.queryAll();
        PageInfo<ProjectCenter> pageInfo = new PageInfo<ProjectCenter>(projectCenterList);
        return pageInfo;
    }

    @Override
    public PageInfo<ProjectCenter> queryByVo(ProjectVo projectVo) {
        Page<IntegralType> page1 = PageHelper.startPage(projectVo.getPageNumber(),projectVo.getPageSize());
        List<ProjectCenter> projectCenterList = this.projectCenterMapper.queryByVo(projectVo);
        PageInfo<ProjectCenter> pageInfo = new PageInfo<ProjectCenter>(projectCenterList);
        return pageInfo;
    }

    @Override
    public ProjectCenter queryById(Integer id) {
        ProjectCenter projectCenter = this.projectCenterMapper.queryById(id);
        return projectCenter;
    }


}
